import request from '@/utils/request'

// 查询结构库列表
export function listStructure(query) {
  return request({
    url: '/fmea/pfmea/structure/list',
    method: 'get',
    params: query
  })
}

// 查询结构库详细
export function getStructure(id) {
  return request({
    url: '/fmea/pfmea/structure/' + id,
    method: 'get'
  })
}

// 新增结构库
export function addStructure(data) {
  return request({
    url: '/fmea/pfmea/structure',
    method: 'post',
    data: data
  })
}

// 修改结构库
export function updateStructure(data) {
  return request({
    url: '/fmea/pfmea/structure',
    method: 'put',
    data: data
  })
}

// 校验节点是否存在
export function checkStructure(query) {
  return request({
    url: '/fmea/pfmea/structure/check',
    method: 'get',
    params: query
  })
}

// 删除结构库
export function delStructure(id) {
  return request({
    url: '/fmea/pfmea/structure/' + id,
    method: 'delete'
  })
}

// 导出结构库
export function exportStructure(query) {
  return request({
    url: '/fmea/pfmea/structure/export',
    method: 'get',
    params: query
  })
}

// 修改版本状态
export function modifyVStatus(query) {
  return request({
    url: '/fmea/pfmea/structure/updateVersionStatus',
    method: 'get',
    params: query
  })
}
// 校验结构库
export function exactStructureKnow(query) {
  return request({
    url: '/fmea/pfmea/structure/exactQuery',
    method: 'get',
    params: query
  })
}

// 下载模板
export function downLoadTemplate(query) {
  return request({
    url: '/fmea/pfmea/structure/downloadImportProcessTemplate',
    method: 'get',
    params: query
  })
}
